package chzhenjia.learn.androidcode.three;

import android.content.Context;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteOpenHelper;

/**
 * 作者:陈圳佳
 * 日期:2015/8/2
 */
public class DBHelper extends SQLiteOpenHelper {


    public DBHelper(Context context) {
        super(context, "test.db", null, 1);
    }

    private void version1(SQLiteDatabase db) {
        db.execSQL("create table person(_id INTEGER PRIMARY KEY AUTOINCREMENT,name char(10),salary double)");
    }

    @Override
    public void onCreate(SQLiteDatabase db) {
        version1(db);
    }

    @Override
    public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {
    }
}
